﻿<local:DocumentBase x:Class="WPFExcelReport.YCAFSACC"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:dat="clr-namespace:System.Windows.Data;assembly=PresentationFramework"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core" 
                    xmlns:wep="clr-namespace:WPFExcelReport" 
                    Loaded="Window_Loaded" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    xmlns:tra="clr-namespace:WPFExcelReport.TranslationByMarkupExtension;assembly=ReflectionStudio.Core"
                    FontSize="14" 
                    Background="White" 
                    Title="辅料信息" 
                    HorizontalAlignment="Stretch"
                    Margin="0,0,0,0" 
                    VerticalAlignment="Stretch"
                    >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:MaskPrice  x:Key="dprice"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:Divideby10000  x:Key="d10000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:String2ColorConverter  x:Key="str2color"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <db:SETINTEXDB  x:Key="SetQP" />
        <CollectionViewSource   x:Key="vwFSACC" Source="{Binding Path=ICC_FSACC,Source={StaticResource SetData}}" />        
    </local:DocumentBase.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
            <RowDefinition Height="*" MinHeight="300"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Expander  Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
            Name="expLog" ExpandDirection="Down" IsExpanded="True">
            <StackPanel>               
                    <WrapPanel Width="1023" Height="38">
                        <Label Content="类型："    Width="52" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                        <TextBox Name="txtTYPE" Width="54" Margin="10,0,0,0"  HorizontalAlignment="Left" CharacterCasing="Upper" Panel.ZIndex="2"
                                 Text="ACC" KeyUp="txtART_KeyUp" Background="Pink" MaxLength="4" FontSize="18" Foreground="#FF141111" Height="33" />
                        <Label Content="辅料编号："    Width="91" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                        <TextBox Name="txtARTICLE" Width="170" Margin="10,0,0,0"  HorizontalAlignment="Left" CharacterCasing="Upper" Panel.ZIndex="1"
                         Focusable="True" KeyUp="txtART_KeyUp" Background="YellowGreen" MaxLength="20" FontSize="18" Foreground="#FF141111" Height="33" />
                        <Label Content="大类："    Width="52" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF141111" />
                        <TextBox Name="txtPRDGRP" Width="62" Margin="10,0,0,0"  HorizontalAlignment="Left" CharacterCasing="Upper" Panel.ZIndex="3"
                             KeyUp="txtART_KeyUp" Background="Pink" MaxLength="3" FontSize="18" Foreground="#FF141111" Height="33" />
                        <Button  Height="30"  Width="30" Margin="10,0,0,0" Name="btnQuery" Click="btnQuery_Click" KeyboardNavigation.TabIndex="6" IsDefault="True" TabIndex="13">
                            <Button.Background>
                                <ImageBrush ImageSource="Images/Search.png" />
                            </Button.Background>
                        </Button>
                        <Button Content="EXCEL" Margin="20,0,0,0" Name="btnReport" Width="47" Click="btnReport_Click" TabIndex="7" />

                </WrapPanel>
            </StackPanel>
        </Expander> 
        <FlowDocumentScrollViewer Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"  >
                <FlowDocument> 
                    <Paragraph>
                    <DataGrid  AutoGenerateColumns="False"
                              EnableRowVirtualization="True"  
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwFSACC}}"  
                              HeadersVisibility="Column"
                              x:Name="MasterDg"    
                              Height="Auto" FontSize="14" FontFamily ="Times New Roman"
                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                              ScrollViewer.VerticalScrollBarVisibility="Auto" >
                        <!-- , Converter={StaticResource ResourceKey=gb2312}-->
                        <!-- FSART,FSABEZ,FSPROGRP,DES,FSARTGRP,PRDGRP,ISIZE,PRICE,FELIEFNR,SUPPLIER-->
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=FSART}" Header="辅料编号" Width="SizeToCells" MinWidth="40" />
                            <DataGridTextColumn Binding="{Binding Path=FSABEZ}" Header="辅料描述" Width="SizeToCells" MinWidth="50" />
                            <DataGridTextColumn Binding="{Binding Path=FSPROGRP}" Header="类型" Width="SizeToCells" MinWidth="30" />
                            <DataGridTextColumn Binding="{Binding Path=DES}" Header="类型描述" Width="SizeToCells" MinWidth="40" />
                            <DataGridTextColumn Binding="{Binding Path=FSARTGRP}" Header="大类" Width="SizeToCells" MinWidth="30" />
                            <DataGridTextColumn Binding="{Binding Path=PRDGRP}" Header="大类描述" Width="SizeToCells" MinWidth="40" />
                            <DataGridTextColumn Binding="{Binding Path=COLOR}" Header="辅料颜色" Width="SizeToCells" MinWidth="30" MaxWidth="150"/>
                            <DataGridTextColumn Binding="{Binding Path=ISIZE}" Header="辅料规格" Width="SizeToCells" MinWidth="30" MaxWidth="150"/>
                            <DataGridTextColumn Binding="{Binding Path=LPRICE}" Header="单价" Width="SizeToCells" MinWidth="40" />
                            <DataGridTextColumn Binding="{Binding Path=LSNAME}" Header="供应商" Width="SizeToCells" MinWidth="30"/>
                        </DataGrid.Columns>
                    </DataGrid > 
                    </Paragraph>
                </FlowDocument>
            </FlowDocumentScrollViewer>     
    </Grid>
</local:DocumentBase>